<template>
  <group>
    <cell v-for="item in doctorList" :title="item.drName" :key="item.drId"></cell>
  </group>
</template>

<script>
  import { mapState } from 'vuex'
  import Group from 'vux/src/components/group/index'
  import Cell from 'vux/src/components/cell/index'

  export default {
    components: {
      mapState,
      Group,
      Cell
    },
    computed: {
      ...mapState({
        orgCode: state => state.vux.orgCode
      })
    },
    methods: {
      getDoctor () {
        let url = 'https://ydt.xy12345.cn/edot/api/apoRe/getDr'
        let param = {
          orgCode: this.orgCode,
          queryType: 1,
          deptId: this.deptId,
          drId: ''
        }
        this.$axios.post(url, this.$qs.stringify(param)).then(response => {
          this.doctorList = response.data.data.body
        })
      }
    },
    mounted () {
      this.$store.commit('updataTitleStatus', '选择医生')
      this.getDoctor()
      this.$store.commit('updataDeptIdStatus', this.deptCode)
    },
    data () {
      return {
        deptId: this.$route.params.id,
        doctorList: []
      }
    }
  }
</script>

<style scoped>

</style>
